home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / exampleCode / viewkit / VCal / HelpAPI.c++ < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-02  |  1.8 KB  |  77 lines

  1. /*
  2.  * Copyright (C) 1994, Silicon Graphics, Inc.
  3.  * All Rights Reserved.
  4.  *
  5.  * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
  6.  * the contents of this file may not be disclosed to third parties, copied or
  7.  * duplicated in any form, in whole or in part, without the prior written
  8.  * permission of Silicon Graphics, Inc.
  9.  *
  10.  * RESTRICTED RIGHTS LEGEND:
  11.  * Use, duplication or disclosure by the Government is subject to restrictions
  12.  * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
  13.  * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
  14.  * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
  15.  * rights reserved under the Copyright Laws of the United States.
  16.  */
  17. #include <stdio.h>
  18. #include <string.h>
  19. #include <Vk/VkHelp.h>
  20. #include <Vk/VkApp.h>
  21. #include "HelpDialog.h"
  22.  
  23. HelpDialog *helpDialog = NULL;
  24.  
  25. typedef struct {
  26.   char *key;
  27.   char *topic;
  28. } KeyInfo;
  29.  
  30. static KeyInfo keys[] = {
  31.   { "popup_popupMenu.overview", "Month View" },
  32.   { "vcal.overview", "Month View" },
  33.   { "dayView.overview", "Day View" },
  34.   { "monthOverview.overview", "Month Overview" },
  35.   { "weekOverview.overview", "Week Overview" },
  36.   { "prefDialog", "Preferences" },
  37.   { "entryAttrDialog", "Entry Attributes" },
  38. };
  39.  
  40. extern "C" {
  41.  
  42. int SGIHelpInit(Display *, char *, char *)
  43. {
  44.   return 1;
  45. }
  46.  
  47. int SGIHelpMsg(char *key, char *, char *)
  48. {
  49.   int each;
  50.  
  51.   theApplication->busy();
  52.   if (!helpDialog) {
  53.     helpDialog = new HelpDialog("helpDialog");
  54.   }
  55.   helpDialog->show();
  56.   if (key) {
  57.     for (each=0; each<XtNumber(keys); each++) {
  58.       if (!strcmp(keys[each].key, key)) {
  59.     helpDialog->topicSelect(keys[each].topic);
  60.     break;
  61.       }
  62.     }
  63.   }
  64.   helpDialog->open();
  65.   helpDialog->raise();
  66.   theApplication->notBusy();
  67.   return 1;
  68. }
  69.  
  70. int SGIHelpIndexMsg(char *key, char *)
  71. {
  72.   SGIHelpMsg(key, NULL, NULL);
  73.   return 1;
  74. }
  75.  
  76. }
  77.